const express=require("express")
const pool=require("../pool")
const server=express.Router();

//首页功能一：轮播图 && 百科页顶部轮播
server.get("/index_fenlei",(req,res)=>{
  var sql="SELECT*FROM index_fenlei";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.send({code:1,data:result})
  })
})

// 挑战赛 
server.get("/tiaozhan",(req,res)=>{
  var sql="SELECT*FROM tiaozhan";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.send({code:1,data:result})
  })
})







  
//导出路由器
module.exports=server